package io.finer.erp.jeecg.bas.util;

import java.util.Map;

import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaInter;
import org.jeecg.modules.online.config.exception.BusinessException;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

@Component("createFQOrderCgform")
public class CreateFQOrderCgform implements CgformEnhanceJavaInter {

	@Override
	public int execute(String arg0, Map<String, Object> arg1) throws BusinessException {
		String jsonString = JSON.toJSONString(arg1);
		JSONObject object = JSON.parseObject(jsonString);
		return this.execute(arg0, object);
	}

	@Override
	public int execute(String arg0, JSONObject arg1) throws BusinessException {
		System.out.println(arg1);
		String fqProcessId = "1300701063685087234";
		//判断是否是分切单
		if(!fqProcessId.equals(arg1.getString("process_id"))){
			return 1;
		}
		
		//{"fq_category":"1306489861099130882","process_id":"1300701063685087234","create_time":1600788445000,"sys_org_code":"A01A03","device_id":"1300723710120697858","is_frozen":0,"create_by":"admin","user_id":"1e2d322d410242238935deb1743123da,f0019fdebedb443c98dcb17d88222c38","fq_params":"20+23+74+40","is_finish":0,"id":"1308231396382461953","order_id":"1308230514861395970","fq_length":3000}

		return 0;
	}

}
